package app.itw.tison.cloud.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.Date;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderItem implements Serializable {

  //订单明细id
  private String id;
  //订单id
  private String oid;
  //商品id
  private String pid;
  //商品金额  单位分
  private int price;
  //商品数量
  private int qty;
  //创建时间
  @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  public OrderItem() {}

  public OrderItem(String id, String oid, String pid, int price, int qty, Date createTime) {
    this.id = id;
    this.oid = oid;
    this.pid = pid;
    this.price = price;
    this.qty = qty;
    this.createTime = createTime;
  }

  public String getId() {
    return id;
  }

  public String getOid() {
    return oid;
  }

  public String getPid() {
    return pid;
  }

  public int getPrice() {
    return price;
  }

  public int getQty() {
    return qty;
  }

  public Date getCreateTime() {
    return createTime;
  }

  @Override
  public String toString() {
    return "OrderItem{" +
        "id='" + id + '\'' +
        ", oid='" + oid + '\'' +
        ", pid='" + pid + '\'' +
        ", price=" + price +
        ", qty=" + qty +
        ", createTime=" + createTime +
        '}';
  }

  public void setId(String id) {
    this.id = id;
  }

  public void setOid(String oid) {
    this.oid = oid;
  }

  public void setPid(String pid) {
    this.pid = pid;
  }

  public void setPrice(int price) {
    this.price = price;
  }

  public void setQty(int qty) {
    this.qty = qty;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }
}
